import axios from "../../utils/axios";

//添加博客
export function addBlog(data) {
    return axios({
        url: '/blog/add',
        method: 'POST',
        data: data
    })
}

export function addDraftBlog(data){
    return axios({
        url:'/blog/saveDraft',
        method:"POST",
        data
    })
}

export function getBlogById(params) {
    return axios({
        url: "/blog/getById",
        method: 'GET',
        params: params
    })
}

export function getBlogList(params) {
    return axios({
        url: '/blog/list',
        method: "GET",
        params: params
    })
}

export function updateBlog(data) {
    return axios({
        url: "/blog/update",
        method: 'POST',
        data
    })
}

export function deleteBlog(data) {
    return axios({
        url: "/blog/delete",
        method: 'POST',
        data
    })
}
